import request from '@/utils/request';

const baseURL = 'http://localhost:39203/carbon/process'

// 查询所有工序及排放源数据
export function queryAllProcess() {
  return request({
    url: '/queryAll',
    method: 'get',
    baseURL: baseURL
  })
}

/**
 * 删除工序
 * @returns {AxiosPromise}
 */
export function deleteProcess(data) {
  return request({
    url: `/deleteProcess/${data}`,
    method: 'delete',
    baseURL: baseURL
  })
}

/**
 * 查询排放源详情
 * @returns {AxiosPromise}
 */
export function queryEmissionOriginDetail(data) {
  return request({
    url: `/queryEmissionOriginDetail/${data}`,
    method: 'get',
    baseURL: baseURL
  })
}

/**
 * 添加工序
 * @returns {AxiosPromise}
 */
export function addProcess(data) {
  return request({
    url: `/addProcess`,
    method: 'post',
    data: data,
    baseURL: baseURL
  })
}

/**
 * 添加能源材料
 * @returns {AxiosPromise}
 */
export function addEmissionOrigin(data) {
  return request({
    url: `/addEmissionOrigin`,
    method: 'post',
    data: data,
    baseURL: baseURL
  })
}

/**
 * 编辑能源材料
 * @returns {AxiosPromise}
 */
export function editEmissionOrigin(data) {
  return request({
    url: `/editEmissionOrigin`,
    method: 'post',
    data: data,
    baseURL: baseURL
  })
}
